import java.util.Scanner;

public class Test {

//调用写模拟用户登入（字符串密码）

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("输入初始密码：");
        String password =sc.nextLine();
        Fan(password);
    }

    public static void Fan(String password) {
        int count=0;
        while(count<3) {
            count++;
            Scanner p = new Scanner(System.in);
            System.out.println("请输入：");
            String n = p.nextLine();
            if(n.equals(password))
            {
                System.out.println("正确");
                break;
            }
            else
            {
                System.out.println("密码不对");
            }
        }
        if(count>3)
        {
            System.out.println("退出");
        }

    }
}
